package com.irdstudio.apicenter.console.controller.Platform;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.irdstudio.apicenter.console.controller.MacmsBaseAction;
import com.irdstudio.apicenter.frame.core.jdbc.container.DataList;
import com.irdstudio.apicenter.frame.core.jdbc.container.PageInfo;
import com.irdstudio.apicenter.frame.core.jdbc.tablemodel.ITableModelDAO;
import com.irdstudio.apicenter.frame.util.BeanUtils;
/**
 * 平台应用类型定义
 * @author guangming.li
 * @version 1.0
 * @date 2016-02-19
 */
@Controller
@RequestMapping(value = "/platform")
public class PlatformAppTypeDefineAction  extends MacmsBaseAction {
	
	@RequestMapping(value = "appTypeDefineList")
	public String appTypeDefineList(HttpServletRequest request) throws Exception {

		// 获取所有参数
		super.getAllRequestData(request);

		// 获取分页参数信息
		PageInfo pageInfo = super.getPageInfo();

		// 查询数据并放入到上下文中
		ITableModelDAO dao = (ITableModelDAO) BeanUtils
				.getBean("tableModelDAO");
		DataList dataList = dao.queryList("select * from app_type_define",
				pageInfo, null);
		super.context.addDataList("atdList", dataList);
		super.context.addPageInfo("atdList", pageInfo);

		// 将数据上下文放到属性中
		request.setAttribute("context", super.context);

		return "admin/appTypeDefineList";
	}

}
